home *** CD-ROM | disk | FTP | other *** search
/ Gigarom 1 / Gigarom Macintosh Archives (Quantum Leap)(CDRM1080320)(1993).iso / FILES / HYP / C-D / DeveloperStax.cpt / Developer Stack 1.0 / background_14011.txt < prev    next >
Text File  |  1989-02-26  |  3KB  |  127 lines

  1. -- background: 14011 from stack: in.0
  2. -- bmap block id: 14709
  3. -- flags: 4000
  4. -- background id: 0
  5. -- name: Mini Hyperstation
  6. ----- HyperTalk script -----
  7. --
  8. --messages from application buttons
  9. --
  10. on NoApp
  11.   global AppButton
  12.   put id of target into AppButton
  13.   InsertApp
  14. end NoApp
  15.  
  16. on ChangeApp
  17.   global AppButton
  18.   put (id of target)+3 into AppButton
  19.   --If the button is blank then get application
  20.   if (the short name of button id AppButton) is space then
  21.     InsertApp
  22.   else
  23.     -- if appliation button is not blank, change or remove it
  24.     put the mouseloc into myPlace
  25.     put item 1 of myPlace - 20 into horiz
  26.     put item 2 of myPlace - 10 into vert
  27.     get PopUpMenu("Change Application;Remove Application",1,vert,horiz)
  28.     put it into PopUpSelected
  29.     -- user wants to change the application
  30.     if PopUpSelected =1 then InsertApp
  31.     --user wants to remove the current application
  32.     if PopUpSelected=2 then
  33.       set name of button id AppButton to space
  34.       set icon of button id AppButton to 0
  35.       set visible of button id (AppButton-1) to true
  36.       set visible of button id (AppButton-2) to true
  37.     end if
  38.   end if
  39. end ChangeApp
  40.  
  41. on InsertApp
  42.   global AppButton
  43.   set hilite of target to false
  44.   put filename("APPL") into LongName
  45.   if LongName is empty then exit InsertApp
  46.   get script of button id AppButton
  47.   delete word 2 of line 2 of it
  48.   put ""&"e&LongName"e after word 1 of line 2 of it
  49.   set the script of button id AppButton to it
  50.   put ConvertButtonName(LongName) into shortName
  51.   --set the icon of the button
  52.   put long name of this stack into thisStack
  53.   put char 8 to (number of chars in thisStack - 1) of thisStack into thisStack
  54.   put GetAppIcon(LongName,LongName,thisStack) into iconNum
  55.   set icon of button id AppButton to iconNum
  56.   --set the name of the button
  57.   set the name of button id AppButton to shortName
  58.   set visible of button id (AppButton-1) to false
  59.   set visible of button id (AppButton-2) to false
  60. end InsertApp
  61.  
  62. on ChangeDoc
  63.   answer "Did you send a disk for the next version?" with "Oops"
  64. end ChangeDoc
  65.  
  66. on ChangeDA
  67.   answer "Did you send a disk for the next version?" with "Uh oh"
  68. end ChangeDA
  69.  
  70. --
  71. --functions
  72. --
  73. function ConvertButtonName LongName
  74. put the length of LongName into nameLength
  75. repeat with x = nameLength down to 1
  76.   if char x of LongName = ":" then exit repeat
  77. end repeat
  78. return char (x + 1) to nameLength of LongName
  79. end ConvertButtonName
  80.  
  81.  
  82.  
  83.  
  84. -- part 115 (button)
  85. -- low flags: 00
  86. -- high flags: 2000
  87. -- rect: left=5 top=309 right=341 bottom=48
  88. -- title width / last selected line: 0
  89. -- icon id / first selected line: 29114 / 29114
  90. -- text alignment: 1
  91. -- font id: 0
  92. -- text size: 12
  93. -- style flags: 0
  94. -- line height: 16
  95. -- part name: New Button
  96. ----- HyperTalk script -----
  97. on mouseUp
  98.   visual venetian blinds to gray
  99.   visual venetian blinds to black
  100.   visual venetian blinds to gray
  101.   visual venetian blinds
  102.  
  103.   go back
  104. end mouseUp
  105.  
  106.  
  107.  
  108. -- part 117 (button)
  109. -- low flags: 00
  110. -- high flags: A003
  111. -- rect: left=212 top=314 right=336 bottom=312
  112. -- title width / last selected line: 0
  113. -- icon id / first selected line: 0 / 0
  114. -- text alignment: 1
  115. -- font id: 0
  116. -- text size: 12
  117. -- style flags: 0
  118. -- line height: 16
  119. -- part name: Open Other...
  120. ----- HyperTalk script -----
  121. on mouseUp
  122.   put filename("APPL") into openthis
  123.   if openthis is empty then exit mouseup
  124.   open openthis
  125. end mouseUp
  126.  
  127.